<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const shopCartList = [
        {
          cartInfoList: [
            {
              skuNum: 1,
              skuPrice: 1299,
            },
            {
              skuNum: 3,
              skuPrice: 777,
            },
            {
              skuNum: 2,
              skuPrice: 900,
            },
          ],
        },

        {
          cartInfoList: [
            {
              skuNum: 2,
              skuPrice: 420,
            },
            {
              skuNum: 4,
              skuPrice: 99,
            },
          ],
        },
      ];

      const result = shopCartList.reduce((prev1, item1) => {
        const item1Re = item1.cartInfoList.reduce((prev2, item2) => {
          return prev2 + item2.skuNum;
        }, 0);

        return item1Re + prev1;
      }, 0);

      console.log(result); //12
    </script>
  </body>
</html>
